package Terminal.View;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;

import Terminal.View.Gestori.GestoreInterfaccia;

public class JBottoniTaskCRUD extends JBottoniTask{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	protected JButton nuovoTask;
	protected JButton modificaTask;
	protected JButton deleteTask;
	
	public JBottoniTaskCRUD(){
		super();
		createComponents();
	}
	
	public void createComponents(){
	
		this.setBounds(20, 601, 1280, 80);
		this.setLayout(null);
		setBottoni();
		add(nuovoTask);
		add(modificaTask);
		add(deleteTask);
	}
	
	private void setBottoni(){
		nuovoTask = new JButton("Nuovo Task");
		nuovoTask.setBounds(200,15,150,50);//100, 30,nuovoTask.getPreferredSize().width,30);
		nuovoTask.addActionListener(new ActionListener() {
					
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mediator.smista("GestireTask", "VisualizzaNuovoTask");				
			}
		});
		
		modificaTask = new JButton("Modifica Task");
		modificaTask.setBounds(890, 15, 180, 50);//.setBounds(1025,15,modificaTask.getPreferredSize().width,50);//900, 30,modificaTask.getPreferredSize().width,30);
		modificaTask.addActionListener(new ActionListener() {
					
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mediator.smista("GestireTask", "VisualizzaModificaTask");				
			}
		});
		
		deleteTask = new JButton("Cancella Task");
		deleteTask.setBounds(1100, 15, 180, 50);//.setBounds(1150, 15,deleteTask.getPreferredSize().width,50);//1100, 30,deleteTask.getPreferredSize().width,30);
		deleteTask.addActionListener(new ActionListener() {
					
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mediator.smista("GestireTask", "VisualizzaDeleteTask");				
			}
		});
		
	}
}


